package com.xbb.service.impl;

import java.util.Date;
import java.util.List;

import javax.annotation.Resource;
import com.xbb.mapper.LevelsMapper;
import com.xbb.entity.Levels;
import com.xbb.service.LevelsService;
import org.springframework.stereotype.Service;

@Service
public class LevelsServiceImpl implements LevelsService {

    @Resource
    private LevelsMapper levelsMapper;

    // 删除数据
    @Override
    public int deleteByPrimaryKey(Integer id) {
        return levelsMapper.deleteByPrimaryKey(id);
    }

    // 插入数据
    @Override
    public int insert(Levels levels) {
        return levelsMapper.insert(levels);
    }

    // 插入数据
    @Override
    public int insertSelective(Levels levels) {
        return levelsMapper.insertSelective(levels);
    }

    // 根据ID查询单个数据
    @Override
    public Levels selectByPrimaryKey(Integer id) {
        return levelsMapper.selectByPrimaryKey(id);
    }

    // 修改数据
    @Override
    public int updateByPrimaryKeySelective(Levels levels) {
        return levelsMapper.updateByPrimaryKeySelective(levels);
    }

    // 修改数据
    @Override
    public int updateByPrimaryKey(Levels levels) {
        return levelsMapper.updateByPrimaryKey(levels);
    }

    // 根据条件查询分页数据
    @Override
    public List<Levels> selectListByPaging(Integer page, Integer limit,String name) {
        return levelsMapper.selectListByPaging(
            (page - 1) * limit,
            limit,
            name
        );
    }

    // 根据条件查询数据条数
    @Override
    public int selectCountByPaging(String name) {
        return levelsMapper.selectCountByPaging(
            name
        );
    }

    // 查询全部数据
    @Override
    public List<Levels> selectAll() {
        return levelsMapper.selectAll();
    }

    // 根据条件查询列表数据
    @Override
    public List<Levels> selectList(Levels levels) {
        return levelsMapper.selectList(levels);
    }

    // 根据字段、排序方式、limit条 查询列表数据
    @Override
    public List<Levels> selectListByLimit(String field, String sort, Integer limit) {
        return levelsMapper.selectListByLimit(field, sort, limit);
    }

    // 根据字段查询列表数据
    @Override
    public List<Levels> selectListByField(String field, Object value) {
        return levelsMapper.selectListByField(field, value);
    }

    // 根据条件查询单个数据
    @Override
    public Levels selectOne(Levels levels) {
        return levelsMapper.selectOne(levels);
    }

    // 根据ID查询详情数据
    @Override
    public Levels selectOneByDetails(Integer id) {
        return levelsMapper.selectOneByDetails(id);
    }

    // 查询全部条数
    @Override
    public int selectAllCount() {
        return levelsMapper.selectAllCount();
    }

    // 根据条件查询数据条数
    @Override
    public int selectCount(Levels levels) {
        return levelsMapper.selectCount(levels);
    }

    // 根据条件修改全部数据
    @Override
    public int updateAll(Levels levels) {
        return levelsMapper.updateAll(levels);
    }

    @Override
    public List<Levels> selectListByIntegrate(Integer integral) {
        return levelsMapper.selectListByIntegrate(integral);
    }
}
